﻿@using CID.Web.Support
@model CID.Web.Models.Infrastructure.ParameterViewModel

@using (Html.KOBeginFormChildEditor("ParameterEdition"))
{
    <fieldset class="innerEditor">
        <legend>Edit Parameter</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Type)
        </div>
        <div class="editor-field">
            @Html.KODropDownListForEnum(m => m.Type, typeof(CID.Domain.Infrastructure.ParameterType))
            @Html.ValidationMessageFor(model => model.Type)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.KOTextBoxFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.KOTextBoxFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model._destroy)

        <span class="field-validation-error" data-bind="visible: !IsValid()">The parameter is invalid, please correct it</span>
        <p>
            <input type="button" value="Apply" data-bind="click: Apply, enable: IsValid"/>
            <input type="button" value="Cancel" data-bind="click: Cancel"/>
        </p>
    </fieldset>
}